home *** CD-ROM | disk | FTP | other *** search
- #pragma once
-
- // StFile.h
- // ©1995 Chris K. Thomas & Rob Guttman. All Rights Reserved.
-
- // • ckt 2 July 1995 - added args per Rob for StandardFile bug fixes.
-
- // Highest Level Interface to StandardFile possible.
- // basically just encapsulates the functionality
- // into a class.
-
- // Note: StandardFile is really unentertaining, so I'd try
- // to avoid it wherever possible.
- // If you're lynched by irate users, don't blame me.
-
- struct SFR
- {
- StandardFileReply reply;
- };
-
- struct StGetFile :public SFR
- {
- StGetFile(const short numTypes, OSType inTypes[1])
- {
- StandardGetFile(NULL, numTypes, inTypes, &reply);
- }
- };
-
- struct StPutFile :public SFR
- {
- // * normal StandardPutFile
- StPutFile(ConstStr255Param prompt, ConstStr255Param defaultName)
- {
- DebugStr("\pFSSpec, dammit");
- StandardPutFile(prompt, defaultName, &reply);
- }
-
- // * alternate accepting default file location
- StPutFile(ConstStr255Param prompt, ConstStr255Param defaultName,
- long dirID, short volumeRefNum)
- {
- LMSetCurDirStore( dirID );
- LMSetSFSaveDisk( volumeRefNum );
- StandardPutFile( prompt, defaultName, &reply );
- }
-
- // * this constructor is the same as the above, only taking arguments
- // * from a FSSpec, which is a logical structure in which to store them
- StPutFile(ConstStr255Param prompt, FSSpec &inSpec)
- {
- LMSetSFSaveDisk( inSpec.vRefNum );
- LMSetCurDirStore( inSpec.parID );
- StandardPutFile( prompt, inSpec.name, &reply );
- }
- };